//
//  MapCreator.m
//  ZeroWorld
//
//  Created by 马进 on 2018/2/9.
//  Copyright © 2018年 马进. All rights reserved.
//

#import "MapCreator.h"
#define NoExit (1000)
@implementation MapCreator

- (MapArea *)createIslandMap {
    MapArea *island = [[MapArea alloc] initWithAreaId:0 name:@"帕里岛" blocks:nil];
    
    NSUInteger waysArr[] = {1, NoExit, NoExit, NoExit};
    MapBlock *block0 = [[MapBlock alloc] initMapBlockWith:0 name:@"帕里港" area:island outWays:[[NSIndexPath alloc] initWithIndexes:waysArr length:4]];
    
    NSUInteger b1Arr[] = {2, 3, 4, 0};
    MapBlock *block1 = [[MapBlock alloc] initMapBlockWith:1 name:@"港口小路" area:island outWays:[[NSIndexPath alloc] initWithIndexes:b1Arr length:4]];
    
    NSUInteger b2Arr[] = {NoExit, 5, NoExit, 1};
    MapBlock *block2 = [[MapBlock alloc] initMapBlockWith:2 name:@"港口小木屋" area:island outWays:[[NSIndexPath alloc] initWithIndexes:b2Arr length:4]];
    
    NSUInteger b3Arr[] = {5, NoExit, 1, NoExit};
    MapBlock *block3 = [[MapBlock alloc] initMapBlockWith:3 name:@"白浪沙滩" area:island outWays:[[NSIndexPath alloc] initWithIndexes:b3Arr length:4]];
    
    NSUInteger b4Arr[] = {NoExit, 1, NoExit, NoExit};
    MapBlock *block4 = [[MapBlock alloc] initMapBlockWith:4 name:@"椰风树林" area:island outWays:[[NSIndexPath alloc] initWithIndexes:b4Arr length:4]];
    
    NSUInteger b5Arr[] = {NoExit, NoExit, 2, 3};
    MapBlock *block5 = [[MapBlock alloc] initMapBlockWith:5 name:@"卵石小径" area:island outWays:[[NSIndexPath alloc] initWithIndexes:b5Arr length:4]];
    
    island.mapBlocks = [NSMutableArray arrayWithObjects:block0, block1, block2, block3, block4, block5, nil];
    return island;
}
@end
